// 算例维护api
import axios from '@/utils/request'

// 分页查询算例列表
export function getAlgoList(data) {
  return axios({
    method: 'get',
    url: '/editor/algorithmInfo/page',
    params: data
  })
}
// 新增算例
export function addAlgo(data) {
    return axios({
        method: 'post',
        url: '/editor/algorithmInfo',
        data
    })
}
// 修改算例
export function editAlgo(data) {
    return axios({
        method: 'put',
        url: '/editor/algorithmInfo',
        data
    })
}
// 删除变量
export function deleteAlgo(ids) {
    return axios({
        method: 'delete',
        url: `/editor/algorithmInfo/${ids}`
    })
}
// 获取符号列表
export function getAlgorithmSymbolList(data) {
    return axios({
      method: 'get',
      url: '/editor/algorithmSymbol/page',
      params: data
    })
  }
// 获取报告列表
export function getReportList(data) {
  return axios({
    method: 'get',
    url: '/editor/documentReportController/queryAllProject',
    params:data
  })
}
// 获取算法结果树
export function getAlgoTree(data) {
  return axios({
    method: 'get',
    url: '/editor/algorithmResult/queryChoiceTree',
    params: data
  })
}
// 生成报告

export function generateReport(data) {
  return axios({
    method: 'post',
    url: '/editor/documentReportController',
    data: data
  })
}
// 删除报告
export function deleteReport(docNo) {
  return axios({
    method: 'delete',
    url: `/editor/documentReportController/${docNo}`,
  })
}
//批量加载变量

export function loadVaribles(data) {
  return axios({
    method: 'post',
    url: '/editor/documentVariable/loadContentByIds',
    data
  })
}
// 加载材料选项
export function loadMeterialOptions() {
  return axios({
    method: 'get',
    url: '/editor/material/getMaterialCategory',
  })
}
//查询材料数据
export function loadMeterialList(data) {
  return axios({
    method: 'post',
    url: '/editor/material/queryMaterials',
    data
  })
}
// 保存变量值
export function saveVeriableValue(data) {
  return axios({
    method: 'post',
    url: '/editor/documentVariable/saveContentById',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    data
  })
}
//  分批次加载变量值
export function initLoadVariableContents(data) {
  return axios({
    method: 'post',
    url: '/editor/documentReportController/initLoadVariableContents',
    data
  })
}
//获取单个文章的状态
export function getStatusByDocno(data) {
  return axios({
    method: 'post',
    url: '/editor/documentReportController/baseInfo',
    data
  })
}
//获取事件状态
export function getEventInfo(data) {
  return axios({
    method: 'get',
    url: '/editor/biz/event/info',
    params:data
  })
}


